<?php

// themes
require_once dirname(__FILE__).'/extensions/html/lib/Mobile_Detect.php';
$detect = new Mobile_Detect();
if ($detect->isTablet()) {
	$this->theme = 'tablet';	
} else if ($detect->isMobile()) {
	$this->theme = 'mobile';
}

// basic access managment
$this->is_teacher = false;
$this->is_admin = false;
if(!isset($_SESSION)) session_start();
// error_log(print_r(($_SESSION),1));
if (isset($_SESSION['f_user_id'])) {
	$this->is_teacher = true;
	if ($_SESSION['f_user_id'] === 'sysadmin') {
		$this->is_admin = true;
	}
}

// site configuration
$this->import('i18n');
// $this->i18n()->lang = 'hu';
$this->page_title = 'Test';
$this->page_template = 'html.page';
$this->navigation = array(
	array('@','Home'),
);

if ($this->is_teacher) {
	$this->navigation[] = array('@classrooms','Classrooms');
}

if ($this->is_admin) {
	$this->navigation[] = array('@users','Users');
}

// basic things
$this->import('html');
$this->import('style');
$this->import('script');
$this->import('asset-manager');
// $this->asset_manager()->mode = 'full';

// less js
$this->import('less-js');
// $this->less_js()->mode = 'server-side';

// ui
$this->import('jquery');
$this->import('form');
$this->import('grid');
$this->import('upload');

// database
$this->import('data');
include(dirname(__FILE__).'/dbconfig.php');
$this->import('users');

require_once dirname(__FILE__).'/include/gam-models.php';

// site
$this->import('admin');
$this->http_header('Content-Type','text/html; charset=utf-8');
$this->style('/extensions/html/styles/reset.css');
$this->style('/extensions/html/styles/f.css');
$this->style('@style.less');

// development
$this->import('docs');
$this->import('test');


